<?php
/**
* 验证码
* @date: 2017年8月11日 下午10:54:46
* @author: hxzlh
*/
namespace app\index\controller;
use think\Exception;
use think\Request;

class Send extends Base 
{
    //获取验证码
    public function sms() 
    {
        try{
            $phone = Request::instance()->post('phone', null, 'trim');
            if (empty($phone)) {
                throw new Exception('参数缺失', '102');
            }
            $model = \think\Loader::model('Sms','service');
            $data = $model->loginSms($phone);
            return parent::returnTrue();
        } catch (Exception $e) {
            $message['code'] = $e->getCode();
            $message['mes'] = $e->getMessage();
            return parent::returnFalse($message);
        }
    }
    
}
